﻿using System;
using System.IO;
using System.Reflection;

namespace eWallet.Data.Local
{

	public partial class eWalletDataSet
	{

		public static void CreateEmptyDatabase(string path)
		{
			Assembly asm = Assembly.GetExecutingAssembly();
			using (var strm = asm.GetManifestResourceStream("eWallet.Data.Local.eWallet.sdf"))
			{
				using (var file = new FileStream(path, FileMode.CreateNew, FileAccess.Write, FileShare.None))
				{
					int i = strm.ReadByte();
					while (i >= 0)
					{
						file.WriteByte((byte)i);
						i = strm.ReadByte();
					}
				}
			}
		}

	}


}
